﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Serialization;

namespace DNA.Mvc
{
    [XmlRoot("page", Namespace = "http://www.dotnetage.com/XML/Schema/page"),
    Serializable]
    public class WebPageTemplate
    {
        [XmlElement("id")]
        public string Name;

        [XmlElement("title")]
        public string Title;

        [XmlElement("description")]
        public string Description;

        [XmlElement("keywords")]
        public string Keywords;

        [XmlElement("link")]
        public string LinkUrl;

        [XmlAttribute("target")]
        public string Target;

        [XmlElement("data")]
        public string Data;

        [XmlElement("layout")]
        public string Layout;

        [XmlElement("icon")]
        public string IconUrl;

        [XmlElement("image")]
        public string ImageUrl;

        [XmlAttribute("anonymous")]
        public bool AllowAnonymous;

        [XmlAttribute("showInMenu")]
        public bool ShowInMenu;

        [XmlAttribute("static")]
        public bool IsStatic;

        [XmlAttribute("shared")]
        public bool IsShared;

        [XmlAttribute("href")]
        public string Path;

        [XmlArray("pages"), XmlArrayItem("page", Type = typeof(WebPageTemplate), Namespace = "http://www.dotnetage.com/XML/Schema/page")]
        public List<WebPageTemplate> Children;

        [XmlArray("widgets"), XmlArrayItem("widget", Type = typeof(WidgetTemplate), Namespace = "http://www.w3.org/ns/widgets")]
        public List<WidgetTemplate> Widgets;
    }
}